package com.life.mapper;

import com.life.annotation.AutoFill;
import com.life.enumeration.OperationType;
import com.life.pojo.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserMapper {
    @Select("select * from user where username = #{username}")
    User getByUsername(String username);

    @Insert("insert into user(username, nickname, password,create_time,update_time) values(#{username}, #{nickname}, #{password},#{createTime},#{updateTime})")
    @AutoFill(OperationType.INSERT)
    void insert(User user);
}
